﻿using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using WorseGame.Common.Configs;

namespace WorseGame.Common.GlobalItems
{
    public class CallbackItem : GlobalItem
    {
        public override bool InstancePerEntity => true;
        protected override bool CloneNewInstances => true;
        public override void SetDefaults(Item item)
        {
            if (ItemConfig.Instance.ItemCallback)
            {
                if (item.type == ItemID.CopperShortsword || item.type == ItemID.TinShortsword || item.type == ItemID.IronShortsword || item.type == ItemID.LeadShortsword || item.type == ItemID.GoldShortsword || item.type == ItemID.PlatinumShortsword || item.type == ItemID.SilverShortsword || item.type == ItemID.TungstenShortsword)
                {
                    item.useStyle = ItemUseStyleID.Thrust;
                    item.DamageType = DamageClass.Melee;
                    item.noUseGraphic = false;
                    item.noMelee = false;
                    item.shoot = ProjectileID.None;
                    item.shootSpeed = 0f;
                }
                if (item.type == ItemID.GoldShortsword)
                {
                    item.damage = 11;
                }
                if (item.type == ItemID.Trident)
                {
                    item.damage = 11;
                    item.knockBack = 5;
                }
                if (item.type == ItemID.LightsBane)
                {
                    item.scale = 1.1f;
                }
                if (item.type == ItemID.Muramasa)
                {
                    item.damage = 19;
                }
                if (item.type == ItemID.BreakerBlade)
                {
                    item.damage = 39;
                }
                if(item.type == ItemID.PalladiumSword)
                {
                    item.damage = 41;
                }
            }
        }
    }
}
